#include "../include/routedraw.h"

namespace drawables
{

namespace vectorMap
{

RouteDraw::RouteDraw(Route* subject, color3 color):MapDrawable(subject)
{
	this->color=color;
}

RouteDraw::~RouteDraw()
{
}

void RouteDraw::draw(Cairo::RefPtr<Cairo::Context> cr)
{
	if (!subject)
		return;
	cr->set_source_rgba(color.r, color.g, color.b, 0.4);
 	vector<Node*>::iterator iter = ((Route*) subject)->nodes.begin();
	 cr->set_line_width(4000);
	cr->move_to( (*iter)->place->x, (*iter)->place->y);
	while(++iter !=((Route*) subject)->nodes.end())
	if((*iter) && (*iter)->place)
		cr->line_to((*iter)->place->x,(*iter)->place->y);
	cr->stroke();
}

}

}

